package cn.gemiman.daoyi.module.cms.dal.mysql.appsitealbum;

import java.util.*;

import cn.gemiman.daoyi.framework.common.pojo.PageResult;
import cn.gemiman.daoyi.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gemiman.daoyi.framework.mybatis.core.mapper.BaseMapperX;
import cn.gemiman.daoyi.module.cms.dal.dataobject.appsitealbum.AppSiteAlbumDO;
import org.apache.ibatis.annotations.Mapper;
import cn.gemiman.daoyi.module.cms.controller.admin.appsitealbum.vo.*;

/**
 * 站点相册 Mapper
 *
 * @author 道一源码
 */
@Mapper
public interface AppSiteAlbumMapper extends BaseMapperX<AppSiteAlbumDO> {

    default PageResult<AppSiteAlbumDO> selectPage(AppSiteAlbumPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppSiteAlbumDO>()
                .eqIfPresent(AppSiteAlbumDO::getAppSiteId, reqVO.getAppSiteId())
                .eqIfPresent(AppSiteAlbumDO::getAppId, reqVO.getAppId())
                .likeIfPresent(AppSiteAlbumDO::getAlbumName, reqVO.getAlbumName())
                .eqIfPresent(AppSiteAlbumDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(AppSiteAlbumDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppSiteAlbumDO::getId));
    }

}